home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / SNNSV32.ZIP / SNNSv3.2 / xgui / sources / o_graph.ph < prev    next >
Encoding:
Text File  |  1994-04-25  |  5.1 KB  |  159 lines

  1. /*****************************************************************************
  2.   FILE           : o_graph.ph
  3.   SHORTNAME      : o_graph.ph
  4.   SNNS VERSION   : 3.2
  5.  
  6.   PURPOSE        : header for o_graph.c
  7.   NOTES          :
  8.  
  9.   AUTHOR         : Markus Heuttel and Michael Schmalzl
  10.   DATE           : 3.4.1992
  11.  
  12.   CHANGED BY     :
  13.   IDENTIFICATION : @(#)o_graph.ph    1.8 3/30/94
  14.   SCCS VERSION   : 1.8
  15.   LAST CHANGE    : 3/30/94
  16.  
  17.              Copyright (c) 1990-1994  SNNS Group, IPVR, Univ. Stuttgart, FRG
  18.              
  19. ******************************************************************************/
  20.  
  21.  
  22. #ifndef _O_GRAPH_DEFINED_
  23. #define _O_GRAPH_DEFINED_
  24.  
  25.  
  26. /* begin global definition section */
  27.  
  28.  
  29. #define MAX_CURVE_NO 25
  30.  
  31.  
  32. void o_createOszi (void);
  33. void o_InitCurve (void);
  34. void o_draw (float);
  35.  
  36.  
  37. typedef struct {
  38.           double ScreenEinheit;
  39.           double Einheit;
  40.         } SCALE_VALUE_TYPE;
  41.  
  42. typedef struct {
  43.           unsigned long  x;
  44.           double y;
  45.     } MPoint;
  46.  
  47.  
  48. int           o_open=0;     /* flag, which indicates whether graf 
  49.                 is open or not */
  50. int           o_PressPossible=1; /* flag : while drawing, pressing a 
  51.                 button has no effect */
  52.  
  53. long unsigned o_LearnStepCount=0; /* counts the learn steps */
  54.  
  55. short   o_CurveLengths[MAX_CURVE_NO]; /* array with the lengths of the 
  56.                 curves Curve1 and Curve2 */
  57. int     o_CurveNo;         /* the number of visible curves on the graf */
  58.  
  59.  
  60. /* end global definition section */
  61.  
  62.  
  63. /* begin private definition section */
  64.  
  65.  
  66. static void o_ClearCurves (void);
  67. static void o_ClearPixmap (Display *, Drawable, GC, int, int, int, int, int);
  68. static void o_DoneProc (void);
  69. static void o_ResizeOszi (int, int);
  70. static void o_ScaleY (Display *, Drawable, GC);
  71. static void o_ScaleX (Display *, Drawable, GC);
  72. static void o_XBack (void);
  73. static void o_XBackProc (void);
  74. static void o_XForward (void);
  75. static void o_XForwardProc (void);
  76. static void o_XScaleCurve (void);
  77. static void o_YBack (void);
  78. static void o_YBackProc (void);
  79. static void o_YForward (void);
  80. static void o_YForwardProc (void);
  81. static void o_YScaleCurve (void);
  82. static void o_clearProc (void);
  83. static void o_eventProc (Widget, Display *, XEvent *);
  84. static void o_init (void);
  85. static Widget o_xCreateButtonItem (char *, Widget, Widget, Widget);
  86. static Widget o_xCreateScreenItem (char *, Widget, Dimension, Dimension, Widget, 
  87.         Widget);
  88.  
  89.  
  90. static float    o_AbsoluteScale;     /* scale factor for the error (y-value)*/
  91. static XPoint *o_Curve1[MAX_CURVE_NO]; /* contains the pixel positons of 
  92.                 the curves */
  93. static MPoint *o_Curve2[MAX_CURVE_NO]; /* contains the coordinates 
  94.                 (o_LearnStepCounter,learn_error) of 
  95.                 the curves */
  96. static Widget          o_DisplayWidget;
  97. static int           o_DrawAllowed;     /* flag, which indicates whether drawing 
  98.                 is allowed or not */
  99. static int    o_LearningStepsOfOnePixel; /* One learning step corresponds with at 
  100.                 least one pixel. For example: 
  101.                                      if you want see 1000 learning steps and 
  102.                      oszi has a width of 100 then
  103.                                      o_LearningStepsOfOnePixel = 10. 
  104.                      If o_PixelsOfOneLearningStep==1 then
  105.                                      o_LearningStepsOfOnePixel==1. 
  106.                      To distinguish the variables 
  107.                      o_LearningStepsOfOnePixel is set to 0*/ 
  108. static int    o_PixelsOfOneLearningStep; /* One Pixel corresponds with at least 
  109.                 one learningstep. For example: if
  110.                                      the graf has a width of 100 Pixels and 
  111.                      you want see only 10 learning
  112.                                      steps, then o_PixelsOfOneLearningStep=10.
  113.                         The minimum value of
  114.                                      o_PixelsOfOneLearningStep is 1 */
  115. static short   o_MaxCurveLengths;     /* the maximum length of the current 
  116.                 curve. This value can change by resizing */
  117. static int o_MaxYDrawPos;
  118. static int o_OsziFrameXPos;
  119. static int o_OsziFrameYPos;
  120. static int o_OsziFrameWidth;
  121. static int o_OsziFrameHeight;
  122. static int o_OsziXPos;
  123. static int o_OsziYPos;
  124. static int o_OsziHeight;
  125. static int o_OsziWidth;
  126. static Pixmap        o_Pixmap;
  127. static int o_PixmapWidth;
  128. static int o_PixmapHeight;
  129. static int o_RightOffset;
  130. static int o_SpaceAbove=20, o_SpaceBelow=30, o_SpaceLeft=60, o_SpaceRight=30;
  131. static int o_WindowWidth;
  132. static int o_WindowHeight;
  133. static int o_XCounter=9;         /* indicates the position in the 
  134.                 array o_XScaleValues */
  135. static int o_YCounter=3;         /* indicates the position in the 
  136.                 array o_YScaleValues */
  137. static SCALE_VALUE_TYPE o_XScaleValues[15]={{50,50000}, {50,25000}, {50,10000},
  138.                 {50,5000}, {50,2500}, {50,1000}, {50,500},
  139.                 {50,250}, {50,100}, {50,50}, {50,25},
  140.                                 {50,10}, {50,5}, {50,2}, {50,1}}; 
  141. static SCALE_VALUE_TYPE o_YScaleValues[15]={{20,0.01}, {20,0.02}, {20,0.05}, 
  142.                 {20,0.1}, {20,0.2}, {20,0.5}, {20,1},
  143.                 {20,2}, {20,5}, {20,10}, {20,20},
  144.                                 {20,50}, {20,100}, {20,200}, {20,500}};
  145. static short o_depth;
  146. static Display      *o_display;
  147. static Widget        o_displayMainWidget;
  148. static XFontStruct  *o_fontStruct;
  149. static Window        o_window;
  150. static GC            o_gc;
  151. static int           o_screen;
  152.  
  153.  
  154. /* end private definition section */
  155.  
  156.  
  157. #endif /* _O_GRAPH_DEFINED_ */
  158.  
  159.